package cn.njxzc.examples;

import java.io.FileInputStream;
import java.io.BufferedInputStream;
import java.io.IOException;

public class Exam9_11 {
	public static void main(String[] args) throws IOException {
		long t = System.currentTimeMillis();
	//	String filename = args[0];
	//	FileInputStream fis = new FileInputStream(filename);
		FileInputStream fis = new FileInputStream("poem.txt");
		BufferedInputStream bis = new BufferedInputStream(fis);
		int count = 0;
		int c;
		while ((c = bis.read()) != -1) {
			if (c == 'A') {
				count++;
			}
		}
		fis.close();
		System.out.println(count);
		t = System.currentTimeMillis() - t;
		System.out.println("Time elapsed:" + t);
	}
}